package com.lanzhou.yuanfen.sys.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lanzhou.yuanfen.sys.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author lcllge
 * @since 2019-12-02
 */
@Mapper
public interface UserMapper extends BaseMapper<User> {

    /**
     * 获取用户信息
     *
     * @param openId
     * @return
     */
    @Select("SELECT a.* FROM sys_user a INNER JOIN sys_social_user b ON a.user_key = b.user_key WHERE open_id = #{openId}")
    User selectUserByOpenId(@Param("openId") String openId);

}
